-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS/Net: implement ioctlv that retrieves the network routing table that libogc now uses on network init #13066
Conversation
64ee640
to
ff10312
Compare
ff10312
to
d6d962b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this PR on some online games (e.g. Monster Hunter Tri, Mario Strikers Charged Football) and didn't find regressions. Otherwise, the PR looks mostly good to me beside some of these coding style related remarks.
Regarding Android, I might be able to implement the routing table using the RouteInfo
class that we're already using to get the network properties.
d6d962b
to
0ba5318
Compare
@dolphin-emu-bot rebuild |
0ba5318
to
b76613f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of using in_addr
members as it makes unambiguous that the values are in network byte order. However, I believe the swaps were done in the wrong places.
357a785
to
c3d6d2b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM and tested on Windows, Linux (debian based) and Android. The Android version seems to be using the Linux part of the code and run properly on my phone (ASUS ROG Phone II). The network interface init properly for all of them.
Regarding the 2 test cases, on Linux/Android bind
will fail due to privilege issues which is normal if not run as admin or with the proper capabilities set.
I guess this PR should be tested on macOS and maybe another Android device to make sure it's working properly.
@sepalani : confirmed working on macos, with it reporting the broadcast instead of gateway like discussed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding error logs might help to diagnose netlink errors, especially on Android.
a4cec7b
to
4c31989
Compare
4c31989
to
e44400f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that, tested on Windows, Linux and Android and working as expected.
142220e
to
9f9b727
Compare
…at libogc now uses on network init
9f9b727
to
386c2fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, LGTM.
Tested on Windows, Linux and Android.
@JMC47 : should be ready for merging. its tested on all platforms with the test cases i provided using latest libogc builds/examples ^^; it even works in the network tool that is on the deadly creatures disc! |
this can be tested with the following dol's
old libogc that only retrieves the IP : sockettest_org.zip
new libogc dol that retrieves the ip, subnet mask and gateway : sockettest.zip
related libogc issue : devkitPro/libogc#179
i was only able to test & implement this decently on windows, linux & android, and macos will need to have somebody that knows it look at it if it is to be implemented decently (it currently creates a fake entry for 0.0.0.0 to be sent to the retrieved gateway/broadcast ip so libogc doesn't error :) )
for macos i found this, but thats it : https://stackoverflow.com/questions/5390164/getting-routing-table-on-macosx-programmatically